package com.isunland.managesystem.adapter;

import android.content.Context;
import com.isunland.managesystem.R;
import com.isunland.managesystem.base.BaseStatusListAdapter;
import com.isunland.managesystem.entity.DataStatus;
import com.isunland.managesystem.entity.ProblemBackOriginal;
import com.isunland.managesystem.utils.MyUtils;
import java.util.List;

/**
 * Created by lenovo on 2016/11/17.
 */
public class ProblemBackListAdapter
    extends BaseStatusListAdapter<ProblemBackOriginal.ProblemBackContent> {

  public ProblemBackListAdapter(Context context, List objects) {
    super(context, objects);
  }

  /**
   * 绑定数据.
   */
  @Override public void bindData(int position, ViewHolder vh,
      ProblemBackOriginal.ProblemBackContent item) {

    vh.mTvTitle.setText(item.getResname());
    vh.mTvContent.setText(item.getFeedback());
    vh.mTvContentTwo.setText(item.getRegStaffName() + "   " + item.getRegDate());
    MyUtils.switchDataStutus(getContext(), vh.mTvStatus, item.getDataStatus());
    if (DataStatus.SUBMIT.equalsIgnoreCase(item.getDataStatus())) {
      vh.mTvStatus.setText(R.string.handle);
    }
    if (DataStatus.PUBLIS.equalsIgnoreCase(item.getDataStatus())) {
      vh.mTvStatus.setText(R.string.hasFinishplan);
    }
    if (DataStatus.ABORT.equalsIgnoreCase(item.getDataStatus())) {
      vh.mTvStatus.setText(R.string.aborted);
    }
  }
}
